import { defineConfig } from "vite"
import path from "path"
import vue from "@vitejs/plugin-vue"

// https://vitejs.dev/config/
export default defineConfig({
  //挂载插件后可以为.vue文件提供支持  
  plugins: [vue()],
  resolve: {
    alias: {
      //给路径取别名，此处将.src取别名为@
      "@": path.resolve(__dirname, "./src"),
    },
  },
  server: {
    host: "localhost",
    port: 3000,
    //启动服务，自动打开浏览器
    open: true,
    strictPort: false,
    https: false,

  // 代理
  // proxy: {
  //  '/api': {
  //          target: 'http://localhost:8080',    //后端提供的接口地址
  //        changeOrigin: true,                 //允许跨域
  //      rewrite: (path) => path.replace(/^\/api/, '')
  //},
  //}
  },
})